package com.edu.juc.threadPool;

import java.math.BigDecimal;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

        String input = scan.nextLine();
        String[] split = input.split(",");

        String product = split[0]; // 商品名称
        BigDecimal price = new BigDecimal(split[1]); // 单价
        int num = Integer.parseInt(split[2]);// 数量

        BigDecimal price1 = null;
        BigDecimal price2 = null;
        BigDecimal price3 = null;
        BigDecimal sum = price.multiply(new BigDecimal(num));
        if (sum.compareTo(new BigDecimal(300)) >= 0) {
            price1 = sum.subtract(BigDecimal.valueOf(80L));
        }

        if (price.compareTo(new BigDecimal(100)) >= 0) {
            price2 = price.multiply(BigDecimal.valueOf(0.85)).multiply(BigDecimal.valueOf(num));
        }

//        BigDecimal end12 = (price2 == null ? price1 : price2);
//        BigDecimal end = (end12 == null ? sum : end12);

        String pattern = null;
        BigDecimal lowPrice = sum;
        if (price1 != null && price2 != null) {
            pattern = price1.compareTo(price2) >= 0 ? "满减促销" : "折扣促销";
            lowPrice = price1.compareTo(price2) >= 0 ? price2 : price1;
        }
        // 低价
        if (price1 != null) {
            pattern = "满减促销";
            lowPrice = price1;
        } else if (price2 != null) {
            pattern = "折扣促销";
            lowPrice = price2;
        }


        if (num >= 5) {
            pattern = "会员专享";
            lowPrice = lowPrice.multiply(BigDecimal.valueOf(0.75));
        }

        System.out.println("商品信息: " + product + ", 单价" + price + ", " + "数量: " + num);
        System.out.println("原始金额: " + sum);
        System.out.println("最优金额: " + lowPrice);
        System.out.println("应用促销: " + pattern);
        System.out.println("节省金额: " + sum.subtract(lowPrice));
        System.out.println("实付比例: " + lowPrice.divide(sum,3, BigDecimal.ROUND_HALF_EVEN).multiply(BigDecimal.valueOf(100L)).toString().substring(0,4) + "%");
    }
}
